import time

import pyautogui

pyautogui.alert(text="123456",title="iyoukrls",button="ok")
# 获取鼠标指针位置
# for _ in range(3):
#     print(pyautogui.position())		# 打印信息： Point(x=1763, y=373)
#     pyautogui.sleep(1)
#     if pyautogui.position() == pyautogui.Point(0, 0): # 鼠标移动到左上角，终端循环
#         break
# 截图
# screenshot = pyautogui.screenshot()
# screenshot.show()
# 假设要找的窗口标题
# window_title = "自动化"

# 获取所有符合标题的窗口
# windows = pyautogui.getWindowsWithTitle(window_title)
#
# for window in windows:
#     # 激活窗口
#     window.activate()
#     # 等待一小段时间确保窗口完全激活
#     time.sleep(1)
#     # 获取窗口的位置（左上角坐标和宽高）
#     window_left, window_top, window_width, window_height = window.left, window.top, window.width, window.height
#     print(f'窗口位置：({window_left}, {window_top})')
#     print(f'窗口大小：{window_width} x {window_height}')
#
#     # 假设相对于窗口的固定位置坐标为 (relative_x, relative_y)
#     relative_x, relative_y = 1161, 610
#     # # 计算相对于桌面的坐标
#     absolute_x = window_left + relative_x
#     absolute_y = window_top + relative_y
#     # # 点击固定位置
#     pyautogui.click(absolute_x, absolute_y)
